-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow ~const
bounds on trait assoc functions
#88418
Allow ~const
bounds on trait assoc functions
#88418
Conversation
3a18b5f
to
523490e
Compare
|
||
trait Foo { | ||
fn a(); | ||
fn b() where Self: ~const Bar; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more tests I think we should have:
where Self: ~const Foo
- a const and a nonconst impl for such a trait
- a monomorphic use that actually runs it
const ANS1: u8 = Const::foo(); | ||
let ans2 = NonConst::foo(); | ||
|
||
assert_eq!(ANS1 + ans2, 42); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beautiful
@bors r+ |
📌 Commit ee02c8e has been approved by |
⌛ Testing commit ee02c8e with merge 98c17e16ab9f27c1948e0c8d9aa262bfa0800128... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors retry |
Rollup of 10 pull requests Successful merges: - rust-lang#85017 (Add carrying_add, borrowing_sub, widening_mul, carrying_mul methods to integers) - rust-lang#86362 (Avoid cloning LocalDecls) - rust-lang#88391 (Fix json tuple struct enum variant ) - rust-lang#88399 (Disallow the aapcs CC on Aarch64) - rust-lang#88418 (Allow `~const` bounds on trait assoc functions) - rust-lang#88445 (Clean up the lowering of AST items) - rust-lang#88495 (Add `TcpStream::set_linger` and `TcpStream::linger`) - rust-lang#88501 (Use right span in prelude collision suggestions with macros. ) - rust-lang#88504 (Keep turbofish in prelude collision lint.) - rust-lang#88524 (Remove unnecessary `mut` from udp doctests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
I got here by TWIR and I never have seen |
it's placeholder syntax for "const if const" trait bounds: #67792 the full updated RFC text can be found at https://internals.rust-lang.org/t/pre-rfc-revamped-const-trait-impl-aka-rfc-2632/15192 |
r? @oli-obk